#pragma once
#include <memory>
#include <netinet/in.h>
#include <string>
#include "InnerType.h"

namespace xncc {
namespace foundation {
    class XnccAddress
    {
      public:
        XnccAddress()          = default;
        virtual ~XnccAddress() = default;

        XnccAddress(const XnccAddress&)             = delete;
        XnccAddress(const XnccAddress&&)            = delete;
        XnccAddress& operator=(const XnccAddress&)  = delete;
        XnccAddress& operator=(const XnccAddress&&) = delete;

        [[nodiscard]] virtual shared::XNCC_ADDR_TYPE Type() const = 0;
        [[nodiscard]] virtual std::string            toStr() const { return ""; }

        [[nodiscard]] virtual sa_family_t family() const = 0;

        [[nodiscard]] virtual auto getSockAddr() const -> const struct sockaddr* { return nullptr; }

        [[nodiscard]] virtual socklen_t getSockLen() const { return static_cast<socklen_t>(-1); }

        static std::shared_ptr<XnccAddress> CreateAddress(const std::string& addr);
    };
}  // namespace foundation
}  // namespace xncc